package com.spring.sd.component;

import com.spring.sd.event.UserRegisteredEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 将 Component2 作为事件监听器：
 */
@Slf4j
@Component
public class Component2 {

    @EventListener
    public void aaa(UserRegisteredEvent event) {
        log.info("事件源：{}", event);
        log.info("发送短信");
    }
}
